package com.ruoyi.system.api.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.api.mapper.JpushLogMapper;
import com.ruoyi.system.api.domain.JpushLog;
import com.ruoyi.system.api.service.IJpushLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 消息推送日志Service业务层处理
 * 
 * @author shihx
 * @date 2020-04-01
 */
@Service
public class JpushLogServiceImpl implements IJpushLogService 
{
    @Autowired
    private JpushLogMapper jpushLogMapper;

    /**
     * 查询消息推送日志
     * 
     * @param id 消息推送日志ID
     * @return 消息推送日志
     */
    @Override
    public JpushLog selectJpushLogById(Long id)
    {
        return jpushLogMapper.selectJpushLogById(id);
    }

    /**
     * 查询消息推送日志列表
     * 
     * @param jpushLog 消息推送日志
     * @return 消息推送日志
     */
    @Override
    public List<JpushLog> selectJpushLogList(JpushLog jpushLog)
    {
        return jpushLogMapper.selectJpushLogList(jpushLog);
    }

    /**
     * 新增消息推送日志
     * 
     * @param jpushLog 消息推送日志
     * @return 结果
     */
    @Override
    public int insertJpushLog(JpushLog jpushLog)
    {
        jpushLog.setCreateTime(DateUtils.getNowDate());
        return jpushLogMapper.insertJpushLog(jpushLog);
    }

    /**
     * 修改消息推送日志
     * 
     * @param jpushLog 消息推送日志
     * @return 结果
     */
    @Override
    public int updateJpushLog(JpushLog jpushLog)
    {
        jpushLog.setUpdateTime(DateUtils.getNowDate());
        return jpushLogMapper.updateJpushLog(jpushLog);
    }

    /**
     * 删除消息推送日志对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJpushLogByIds(String ids)
    {
        return jpushLogMapper.deleteJpushLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除消息推送日志信息
     * 
     * @param id 消息推送日志ID
     * @return 结果
     */
    @Override
    public int deleteJpushLogById(Long id)
    {
        return jpushLogMapper.deleteJpushLogById(id);
    }
}
